<?php
include_once("core/normal.php");

class TableInfos extends Normal{

  public function tableExists($tableName){
    global $configDBdatabase;
    $result = $this->database->queries('SHOW TABLES FROM '.$configDBdatabase);
    while($row=$result->fetch_row()){
      if($row[0]==$tableName) return true;
    }
    return false;
  }

  public function tableRows($tableName){
    $cols=Array();
    $result = $this->database->queries('SHOW COLUMNS FROM '.$tableName);
    while($row=$result->fetch_row()){
      $cols[] = Array($row[0],$row[1]);
    }
    return $cols;
  }

}

?>
